package com.example.composableexample.snackbar

import android.content.Context

internal class ErrorHandlerDelegate(
    private val context: Context,
    private val snackBarDelegate: SnackBarDelegate
) {
    fun defaultHandleFailure(failure: Failure) {
        when(failure) {
            is Failure.ServerError -> snackBarDelegate.showSnackBar(SnackBarState.ERROR, "server_error")
            else -> {}
        }
    }
}